﻿using System;
using System.Globalization;

namespace Testing.Helpers.Processes
{
    public static class AppInstaller
    {
        /// <summary>
        /// Installs application in quite mode during timeout.
        /// </summary>
        /// <param name="setupFilePath">Setup application exe file path.</param>
        /// <param name="arguments">Installation arguments.</param>
        /// <param name="timeout">Installation timeout.</param>
        public static void InstallAppInQuiteMode(string setupFilePath, string arguments, int timeout)
        {
            string installArguments = String.Format(CultureInfo.CurrentCulture,
                                                    "/q /i {0} {1}",
                                                    setupFilePath, arguments);
            ProcessHelper.RunProcess("msiexec", installArguments, timeout);
        }
    }
}
